package com.jumi.microservice.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.jumi.microservice.common.base.AbstractObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 商品sku库存表
 * </p>
 *
 * @author liuz
 * @since 2020-08-11
 */
@TableName("inventory_goods_stock")
@ApiModel(value="GoodsStock对象", description="商品sku库存表")
public class GoodsStockDO extends AbstractObject implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商品sku id")
    private Long goodsSkuId;

    @ApiModelProperty(value = "商品sku编码")
    private String goodsSkuCode;

    @ApiModelProperty(value = "商品spu id")
    private Long goodsId;

    @ApiModelProperty(value = "sku 总库存")
    private Integer goodsSkuStorage = 0;

    @ApiModelProperty(value = "预售库存")
    private Integer preStorage = 0;

    @ApiModelProperty(value = "sku初始的预售库存")
    private Integer initialPreStorage = 0;

    @ApiModelProperty(value = "锁定库存")
    private Integer lockedStorage = 0;

    @ApiModelProperty(value = "已销售库存")
    private Integer saledStorage = 0;

    @ApiModelProperty(value = "并发版本控制")
    @Version
    private Integer version;

    @ApiModelProperty(value = "添加时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getGoodsSkuCode() {
        return goodsSkuCode;
    }

    public void setGoodsSkuCode(String goodsSkuCode) {
        this.goodsSkuCode = goodsSkuCode;
    }

    public Integer getGoodsSkuStorage() {
        return goodsSkuStorage;
    }

    public void setGoodsSkuStorage(Integer goodsSkuStorage) {
        this.goodsSkuStorage = goodsSkuStorage;
    }

    public Integer getLockedStorage() {
        return lockedStorage;
    }

    public void setLockedStorage(Integer lockedStorage) {
        this.lockedStorage = lockedStorage;
    }

    public Integer getSaledStorage() {
        return saledStorage;
    }

    public void setSaledStorage(Integer saledStorage) {
        this.saledStorage = saledStorage;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public Long getGoodsSkuId() {
        return goodsSkuId;
    }

    public void setGoodsSkuId(Long goodsSkuId) {
        this.goodsSkuId = goodsSkuId;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getPreStorage() {
        return preStorage;
    }

    public void setPreStorage(Integer preStorage) {
        this.preStorage = preStorage;
    }

    public Integer getInitialPreStorage() {
        return initialPreStorage;
    }

    public void setInitialPreStorage(Integer initialPreStorage) {
        this.initialPreStorage = initialPreStorage;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "GoodsStockDO{" +
                "id=" + id +
                ", goodsSkuId=" + goodsSkuId +
                ", goodsSkuCode='" + goodsSkuCode + '\'' +
                ", goodsId=" + goodsId +
                ", goodsSkuStorage=" + goodsSkuStorage +
                ", preStorage=" + preStorage +
                ", initialPreStorage=" + initialPreStorage +
                ", lockedStorage=" + lockedStorage +
                ", saledStorage=" + saledStorage +
                ", version=" + version +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
